# Maintainer: Felix Yan <felixonmars@archlinux.org>

_npmname=material-design-icons
pkgname=nodejs-$_npmname
pkgver=3.0.1
pkgrel=5
pkgdesc="Material Design icons by Google"
arch=('any')
url="https://google.github.io/material-design-icons/"
license=('Apache')
depends=('nodejs')
makedepends=('npm')
source=("https://registry.npmjs.org/$_npmname/-/$_npmname-$pkgver.tgz")
noextract=($_npmname-$pkgver.tgz)
sha256sums=('e883868c34b21355763fc69d117d658d9c0f4be35711fa6654e57342e6201f7b')
options=("!strip")

package() {
  npm install -g --user root --prefix "$pkgdir"/usr "$srcdir"/$_npmname-$pkgver.tgz

  # Fix permissions
  find "$pkgdir/usr" -type d -exec chmod 755 '{}' +

  # npm gives ownership of ALL FILES to build user
  # https://bugs.archlinux.org/task/63396
  chown -R root:root "${pkgdir}"
}
